/*
 * This file is part of aKoustiK.

 * aKoustiK is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * aKoustiK is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with aKoustiK.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef INTERNALSTORAGE_H
#define INTERNALSTORAGE_H

#include <kore.h>
#include <playlist.h>

#include <QtCore/QObject>

/**
  Class that helps in handling current playlist.
  */
class InternalStorage : public QObject {
    Q_OBJECT

public:
    /** Method to store current playlist.
      It's asynchronius method, but will
      submit the job to the invoker's
      thread using QTimer. */
    static void store(Playlist* playlist = Kore::instance().playlist());
    /** Method to load current playlist
      and construct Playlist object
      with name and list of items. */
    static Playlist* loadCurrentPlaylist();

    ~InternalStorage();

private:
    InternalStorage(Playlist* targetPlaylist);
    Playlist* playlist;

private slots:
    void exec();
};

#endif
